#include <stdio.h>
enum 
{
    Success =0,
    Div_zone=1,
    Mov_zone=2,
};

int exit_code=Success;

const char *codetostring(int code)
{
    switch(code)
    {
        case Success:
            return "success";
        case Div_zone:
            return "Div_zone";
        case Mov_zone:
            return "Mov_zone";
        default:
            return "non error";
    }
}

int Div(int x,int y)
{
    //if(0==y)
    //{
    //    //除以0 的错误
    //    exit_code=Div_zone;
    //    return -1;
    //}
    //else 
    //{
    //    return x/y;
    //}
    return x/y;
}
int main()
{
    int result=0;
    result = Div(10,5);
    printf("return=%d,%d = [%s]\n",result,exit_code,codetostring(exit_code));
    result=0;
    result = Div(10,0);
    printf("return=%d,%d = [%s]\n",result,exit_code,codetostring(exit_code));
    return exit_code;
}
